#include <cstdio>
#include <stdlib.h>
#include "hthread.hpp"
#include "simd_thl.h"

__mpe__ int main(int argc, char **argv){
  hthread_init();
  int t0 = 1;
  int t1 = 2;
  hparallel([=, &t1]() __cpe__ {
    int myid;
    asm volatile("rcsr %0, 0\n\t":  "=r"(myid));
    if (myid == 0){
      printf("passing lambda: t0=%d, and set t1 = 3\n", t1);
      t1 = 3;
    }
  });
  printf("%d\n", t1);
}
